package com.taotao.module.bigdata.consumer.initbean;


import com.taotao.module.bigdata.consumer.conf.PropertiesConf;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;


import java.util.Map;


public class InitConsumerListen {
    private Map properties = PropertiesConf.consumerSingleConf();


    public void putKafka() {
        while (true) {


            KafkaProducer producer = new KafkaProducer(properties);
            // Create Topic Automaticlay
            producer.send(new ProducerRecord("lego1", "legoTESAT"));
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }


    }
}
